import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Ab04VO, Ab04Form, Ab04Query } from '@/api/yuanshidian/ab04/types';

/**
 * 查询原人员账户明细(缴费明细)列表
 * @param query
 * @returns {*}
 */

export const listAb04 = (query?: Ab04Query): AxiosPromise<Ab04VO[]> => {
  return request({
    url: '/yuanshidian/ab04/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询原人员账户明细(缴费明细)详细
 * @param ID
 */
export const getAb04 = (ID: string | number): AxiosPromise<Ab04VO> => {
  return request({
    url: '/yuanshidian/ab04/' + ID,
    method: 'get'
  });
};

/**
 * 新增原人员账户明细(缴费明细)
 * @param data
 */
export const addAb04 = (data: Ab04Form) => {
  return request({
    url: '/yuanshidian/ab04',
    method: 'post',
    data: data
  });
};

/**
 * 修改原人员账户明细(缴费明细)
 * @param data
 */
export const updateAb04 = (data: Ab04Form) => {
  return request({
    url: '/yuanshidian/ab04',
    method: 'put',
    data: data
  });
};

/**
 * 删除原人员账户明细(缴费明细)
 * @param ID
 */
export const delAb04 = (ID: string | number | Array<string | number>) => {
  return request({
    url: '/yuanshidian/ab04/' + ID,
    method: 'delete'
  });
};
/**
 * 审核
 * @param query
 * @returns {*}
 */

export const examine = (query?: Ab04Query): AxiosPromise<Ab04VO[]> => {
  return request({
    url: '/yuanshidian/ab04/examine',
    method: 'post',
    data: query
  });
};
/**
 * 缴费明细驳回
 * @param ID
 */
export const turndownab04 = (ID: string | number): AxiosPromise<Ab04VO> => {
  return request({
    url: '/yuanshidian/ab04/turndown/' + ID,
    method: 'get'
  });
};
export const ab04Calculation = (query?: Ab04Query): AxiosPromise<Ab04VO[]> => {
  return request({
    url: '/yuanshidian/ab04/ab04Calculation',
    method: 'post',
    data: query
  });
};

/**
 * 删除信息
 * @param ID
 */
export const delAbBatch04 = (ID: string | number) => {
  return request({
    url: '/yuanshidian/ab04/batch/' + ID,
    method: 'delete'
  });
};

//批量导入
export const downloadTemplate = (ID: string | number): AxiosPromise<Ab04VO> => {
  return request({
    url: '/yuanshidian/ab04/downloadTemplate',
    method: 'get'
  });
};